package com.aaa.marketresearch.android.data;

/**
 * @author Nail
 */
public class ServerInfo {

    public enum ServerCode {
        AMAZON,
        DEVELOPMENT,
        UserRoleEnum() {}
    }

    private static final ServerInfo instance = new ServerInfo();

    private String ip = "ec2-54-187-94-253.us-west-2.compute.amazonaws.com";

    private String port = "8080";

    private String url;

    public static ServerInfo getInstance() {
        return instance;
    }

    public void setServer(String server) {
        if (server.equalsIgnoreCase(ServerCode.AMAZON.name())) {
            this.ip = "ec2-54-187-94-253.us-west-2.compute.amazonaws.com";
        } else if (server.equalsIgnoreCase(ServerCode.DEVELOPMENT.name())) {
            this.ip = "nailsharipov.asuscomm.com";
        }
        this.url = null;
    }

    public String getServerUrl() {
        if (this.url == null) {
            this.url = "http://" + this.ip + ":" + this.port + "/WebClient";
        }
        return this.url;
    }


    private ServerInfo() {

    }

}
